package com.sea.data.mapper;

import com.sea.data.entity.Order;
import com.sea.data.entity.SalesForecast;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;


/**
 *  请购单接口
 * @author 陈鸿飞
 * <br/>
 */
public interface SalesForecastMapper {
    /**
     * 查询指定
     * @param salesForecast
     * @return
     */
    List<SalesForecast> findByCnd(SalesForecast salesForecast);

    /**
     * 新增
     * @param salesForecast
     * @return
     */
    Integer insert(SalesForecast salesForecast);
    /**
     * 查询指定
     * @param salesForecast
     * @return
     */
    SalesForecast findBySkuDateChannel(SalesForecast salesForecast);

    /**
     * 更新
     * @param salesForecast
     * @return
     */
    Integer update(SalesForecast salesForecast);

    /**
     * 获取Listing分组
     * @return
     */
    List<SalesForecast> groupByListing();

    /**
     * 获取日期分组
     * @return
     */
    List<SalesForecast> groupBySalesDate();

    /**
     * 获取月份分组
     * @return
     */
    List<SalesForecast> groupBySalesMonth();

    Double findBySalesNumber(@Param("beginDate")String beginDate,
                              @Param("endDate")String endDate,
                              @Param("salesListing")String salesListing);

    Integer findByProduceNumber(@Param("beginDate")String beginDate,
                                @Param("endDate")String endDate,
                                @Param("salesListing")String salesListing);

    Integer findByPhysicalNumber(@Param("beginDate")String beginDate,
                                 @Param("endDate")String endDate,
                                 @Param("salesListing")String salesListing);

    List<SalesForecast> findBySalesDate();

    /**
     * 查找基础数据
     * @return
     */
    List<Map<String,Object>> findReportByListingAsin(@Param("list") List<String> list,@Param("mList")List<String> mList);

    List<SalesForecast> findSellNumber(SalesForecast salesForecast);

    /**
     * 数据重置
     * @return
     */
    Integer resetStock();

    /**
     * 数据重置
     * @return
     */
    Integer resetSalesForecast();
}